﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace ErhuBlog.IService
{
    public interface IBaseServices<Tentity> where Tentity:class
    {
        List<Tentity> QueryWhere(Expression<Func<Tentity, bool>> predicate);
        List<Tentity> QueryJoin(Expression<Func<Tentity, bool>> predicate,string[] tableNames);
        List<Tentity> QueryOrderBy<Tkey>(Expression<Func<Tentity, bool>> predicate, Expression<Func<Tentity, Tkey>> keySelector, bool IsQueryOrderBy);
        List<Tentity> QueryByPage<Tkey>(int pageIndex, int pagesize, out int rowcount, Expression<Func<Tentity, bool>> predicate, Expression<Func<Tentity, Tkey>> keySelector, bool IsQueryOrderBy);
        void Edit(Tentity model, string[] propertys);
        void Edit(Tentity model);
        void Delete(Tentity model, bool isadded);
        void Add(Tentity model);
        int SaveChanges();
        List<TResult> RunProc<TResult>(string sql, params object[] pamrs);


    }
}
